#include "sys_tim.h"


void Timer_config(void)
{
	TIM_InitTypeDef		TIM_InitStructure;					
	TIM_InitStructure.TIM_Mode      = TIM_16BitAutoReload;	//ָTIM_16BitAutoReload,TIM_16Bit,TIM_8BitAutoReload,TIM_16BitAutoReloadNoMask
	TIM_InitStructure.TIM_ClkSource = TIM_CLOCK_1T;			//ָTIM_CLOCK_1T,TIM_CLOCK_12T,TIM_CLOCK_Ext
	TIM_InitStructure.TIM_ClkOut    = DISABLE;				//ENABLE DISABLE
	TIM_InitStructure.TIM_Value     = (u16)(65536UL - (MAIN_Fosc / 1000UL));	
	TIM_InitStructure.TIM_PS        = 0;				
	TIM_InitStructure.TIM_Run       = ENABLE;			
	Timer_Inilize(Timer0,&TIM_InitStructure);				//Timer0,Timer1,Timer2,Timer3,Timer4
	NVIC_Timer0_Init(ENABLE,Priority_0);					// Priority_0,Priority_1,Priority_2,Priority_3
}
